From 51e4a7555d67734dfca37869195cc8eca7315a47 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 16 Jun 2009 11:00:29 +0100 Subject: [PATCH] xend: allow config file compatibility with new tap syntax Recently the format of the tap syntax in the config file changed to using a 4 part specifier (tap:tapdisk::) instead of the old 3-part one (tap::). This breaks compatibility with existing config files: a guest start will throw a Python exception and will be aborted. AFAICS currently tap:tapdisk is redundant, so the attached patch simply catches the above mentioned exception and tries to parse the old format in this case. Signed-off-by: Andre Przywara --- tools/python/xen/xend/server/BlktapController.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/server/BlktapController.py b/tools/python/xen/xend/server/BlktapController.py index 7c592932c2..59fb2f78aa 100644 --- a/tools/python/xen/xend/server/BlktapController.py +++ b/tools/python/xen/xend/server/BlktapController.py @@ -120,8 +120,12 @@ class BlktapController(BlkifController): def createDevice(self, config): - uname = config.get('uname', '') - (typ, subtyp, params, file) = string.split(uname, ':', 3) + uname = config.get('uname', '') + try: + (typ, subtyp, params, file) = string.split(uname, ':', 3) + except: + (typ, params, file) = string.split(uname, ':', 2) + subtyp = 'tapdisk' if typ in ('tap'): if subtyp in ('tapdisk'): if params in ('ioemu', 'qcow2', 'vmdk', 'sync'): -- 2.30.2